﻿#ifndef MBASEVIEW_H
#define MBASEVIEW_H
#include <QGraphicsView>
#include <QMouseEvent>
#include <QWheelEvent>


class MBaseView : public QGraphicsView
{
public:
    explicit MBaseView(QGraphicsScene *scene ,QWidget *parent = nullptr);
    ~MBaseView();


    //用于鼠标定位,指定添加的位置
    QPointF LocatePoint;
    //指定鼠标移动时的十字线
    QPointF mousePt;


protected:

    virtual void mousePressEvent(QMouseEvent *event) override;
    virtual void mouseMoveEvent(QMouseEvent *event) override;
    virtual void mouseReleaseEvent(QMouseEvent *event) override;
    virtual void wheelEvent(QWheelEvent *event) override;
    //背前景事件

    virtual void drawForeground(QPainter *painter, const QRectF &rect) override;




};

#endif // MBASEVIEW_H
